<template>
	<view class="padding10-30">
		<block v-for="(item,index) in records" :key="index">
			<view class="row j-sb a-center listrecord p-top30 p-bot30 ">
				<text class="white h6">抽中{{item.name}}</text>
				<text class="color_aa h6 m-top10">{{item.createtime}}</text>
			</view>
		</block>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				getMore: true,
				goodsId: '',
				records: [],
				page: 1,
				pagesize: 20,
			}
		},
		onLoad(e) {
			if (e.goodsId) this.goodsId = e.goodsId;
			 this.awardRecord();
		},
		methods: {
			awardRecord() {
				this.$http.post('manghe/awardRecord', {
					p_goods_id: this.goodsId,
					page: this.page,
					pagesize: this.pagesize
				}).then(res => {
					if (res.code != 1) return;
					if (!res.data.data) return this.getMore = false;
					this.page == 1 ? this.records = res.data.data : this.records = this.records.concat(res.data.data);
				})
			},
		},
		onReachBottom() {
			if (!this.getMore) return;
			this.page++;
			this.awardRecord();
		}
	}
</script>
<style>
	page {
		background-color: #23272C;
	}
</style>
<style lang="scss" scoped>
	.listrecord {
		border-bottom: 1px solid #AAAAAA;
	}
</style>
